package com.bestcem.xm.member.mq;//package com.bestcem.xm.member.mq;
//
//import com.bestcem.xm.config.RabbitMqConstantConfig;
//import org.springframework.amqp.core.Binding;
//import org.springframework.amqp.core.BindingBuilder;
//import org.springframework.amqp.core.DirectExchange;
//import org.springframework.amqp.core.Queue;
//import org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory;
//import org.springframework.amqp.rabbit.connection.ConnectionFactory;
//import org.springframework.amqp.rabbit.listener.RabbitListenerContainerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
///**
// * 分组规则修改 消息队列配置
// *
// * @author ympan <yuming.pan@idiaoyan.com>
// * @version v1.0
// * @date 17:37 2022/1/17
// */
//@Configuration
//public class GroupingRabbitConfig {
//    @Autowired
//    private RabbitMqConstantConfig rabbitMqConstantConfig;
//
//    @Bean("groupingQueue")
//    public Queue groupingQueue() {
//        return new Queue(rabbitMqConstantConfig.getAppBpMemberGroupingQueue(), true,
//                false, false);
//    }
//
//    @Bean("groupingExchange")
//    public DirectExchange groupingExchange() {
//        return new DirectExchange(rabbitMqConstantConfig.getAppBpMemberGroupingExchange(), true,
//                false);
//    }
//
//    @Bean("groupingBinding")
//    public Binding groupingBinding() {
//        return BindingBuilder.bind(groupingQueue()).to(groupingExchange())
//                .with(rabbitMqConstantConfig.getAppBpMemberGroupingRoutingKey());
//    }
//
//    @Bean("groupingFactory")
//    public RabbitListenerContainerFactory<?> groupingFactory(ConnectionFactory connectionFactory) {
//        // SimpleRabbitListenerContainerFactory发现消息中有content_type有text就会默认将其转换成string类型的（类型如application/x-msgpack）
//        SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
//        factory.setPrefetchCount(2);
//        factory.setConnectionFactory(connectionFactory);
//        return factory;
//    }
//}
//